package com.ruoyi.zhjd.collect.modules.dosage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.zhjd.collect.modules.dosage.dto.CollectDosageDto;
import com.ruoyi.zhjd.collect.modules.dosage.entity.CollectDosageEntity;
import com.ruoyi.zhjd.collect.modules.dosage.mapper.LCollectDosageMapper;
import com.ruoyi.zhjd.collect.modules.dosage.service.LCollectDosageService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * 消耗信息
 */
@Service
public class LCollectDosageServiceImpl extends ServiceImpl<LCollectDosageMapper, CollectDosageEntity>
        implements LCollectDosageService {

//    @Autowired
//    private BaseServiceComponent baseServiceComponent;

    @Override
    public IPage<CollectDosageDto> page(Map<String, Object> params) {
        IPage<CollectDosageDto> page = null;
        return baseMapper.query(page, params);
    }

    /**
     * 根据盘次获取用料情况
     *
     * @param pieceId 盘次ID
     */
    @Override
    public List<CollectDosageEntity> queryByPieceId(Long pieceId) {
        QueryWrapper<CollectDosageEntity> wrapper = new QueryWrapper<>();
        wrapper.eq("parent_pk_id", pieceId);
        return baseMapper.selectList(wrapper);
    }


}
